// 暂时性死区(TDZ):如果区块中存在let和const命令，这个区块对这些命令声明的变量，
            //从一开始就形成了封闭作用域。凡是在声明之前就使用这些变量，就会报错。


//------------1----------
var a=3;
console.log(a);//报错：Identifier 'a' has already been declared
let a;

//------------2----------
(function(){
    var b=1;
    console.log(b);//报错：Identifier 'b' has already been declared
    let b;
}())



//-----------3------------
var c=0
console.log(c);
(function(){
    console.log(c);//undefined
    var c=1;
    console.log(c);//1
    // let c;
}())

function s(){
    console.log(c);//0
}
s()